;+
; NAME:
;       REID_BAR_ROTCURVE
;
; PURPOSE:
;       Calculates the Galactic rotation curve presented in Reid et al.
;       (2009, ApJ, 700, 137), but including a Galactic bar with (more
;       or less) solid-body rotation.
;
; CATEGORY:
;       Novelty
;
; CALLING SEQUENCE:
;       theta = REID_BAR_ROTCURVE( R )
;
; INPUTS:
;       R    -- Galactocentric radius, normalized to R0
;
; OPTIONAL INPUTS:
;       NONE
;
; KEYWORD PARAMETERS:
;       NONE
;
; OUTPUTS:
;       THETA -- Rotational velocity at the radius R
;
; OPTIONAL OUTPUTS:
;       NONE
;
; MODIFICATION HISTORY:
;
;       Created:  01/23/12, TPEB -- Initial Version
;      
;-

FUNCTION REID_BAR_ROTCURVE, R, cutoff
  
  IF n_elements(cutoff) EQ 0 THEN cutoff = 0.5
  
  ;; Get galactic params
  defsysv, '!MW', exists = exists
  IF NOT exists THEN galactic_params 
  
  mo = R GE cutoff
  mi = R LT cutoff
  
  vo = mo * !MW.V0
  vi = mi * (!MW.V0 / cutoff * R)
  
  vel = vi + vo
  
  RETURN,vel
END
